//
//  BSTjgzRightCell.m
//  BaiSiBuDeJie
//
//  Created by chaoyi on 16/8/25.
//  Copyright © 2016年 tsaievan. All rights reserved.
//

#import "BSTjgzRightCell.h"
#import "UIImageView+WebCache.h"

@interface BSTjgzRightCell ()
@property (weak, nonatomic) IBOutlet UIImageView *headerImgView;
@property (weak, nonatomic) IBOutlet UILabel *screenNameLab;
@property (weak, nonatomic) IBOutlet UILabel *fansCountLab;

@end

@implementation BSTjgzRightCell

static NSString *TjgzRightCell = @"BSTjgzRightCell";

+ (instancetype)tjgzRightCell:(UITableView *)tableView{
    
    BSTjgzRightCell *cell = [tableView dequeueReusableCellWithIdentifier:TjgzRightCell];
    
    if(!cell){
        
        cell = [[NSBundle mainBundle]loadNibNamed:@"BSTjgzRightCell" owner:nil options:nil].lastObject;
        
        cell.backgroundColor = [UIColor whiteColor];
        
    }
    
    return cell;
}


//- (void)setModel:(SBGzrModel *)model{
//
//    _model = model;
//
//    //头像
//    [self.headerImgView sd_setImageWithURL:[NSURL URLWithString:model.header]];
//
//
//    self.screenNameLab.text = model.screen_name;
//
//    if([model.fans_count isKindOfClass:[NSNumber class]]){
//
//        NSNumberFormatter* numberFormatter = [[NSNumberFormatter alloc] init];
//
//        self.fansCountLab.text = [numberFormatter stringFromNumber:model.fans_count];
//    }else{
//
//        self.fansCountLab.text = model.fans_count;
//    }
//
//    if(model.is_vip){
//
//        self.screenNameLab.textColor = [UIColor redColor];
//
//    }else{
//
//        self.screenNameLab.textColor = [UIColor blackColor];
//    }
//
//
//}

- (void)setTopModel:(Top_List *)topModel{
    
    if([topModel isKindOfClass:[Top_List class]]){
        
        _topModel = topModel;
        //头像
        [self.headerImgView sd_setImageWithURL:[NSURL URLWithString:topModel.header]];
        
        
        self.screenNameLab.text = topModel.screen_name;
        
        
        
        self.fansCountLab.text = topModel.fans_count;
        
        
        if(topModel.is_vip){
            
            self.screenNameLab.textColor = [UIColor redColor];
            
        }else{
            
            self.screenNameLab.textColor = [UIColor blackColor];
        }
        
    }
    
    
}

- (void)setOtherModel:(List *)otherModel{
    
    if([otherModel isKindOfClass:[List class]]){
        
        _otherModel = otherModel;
        
        //头像
        [self.headerImgView sd_setImageWithURL:[NSURL URLWithString:otherModel.header]];
        
        
        self.screenNameLab.text = otherModel.screen_name;
        
        
        
        self.fansCountLab.text = [NSString stringWithFormat:@"%ld",otherModel.fans_count];
        
        
        if(otherModel.is_vip){
            
            self.screenNameLab.textColor = [UIColor redColor];
            
        }else{
            
            self.screenNameLab.textColor = [UIColor blackColor];
        }
        
    }
    
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

@end
